package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.JtUserPromotionCodeRelMapper;
import com.ruoyi.business.domain.JtUserPromotionCodeRel;
import com.ruoyi.business.service.IJtUserPromotionCodeRelService;
import com.ruoyi.common.core.text.Convert;

import javax.validation.constraints.NotNull;

/**
 * 推广码绑定关系Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2025-03-29
 */
@Service
public class JtUserPromotionCodeRelServiceImpl implements IJtUserPromotionCodeRelService 
{
    @Autowired
    private JtUserPromotionCodeRelMapper jtUserPromotionCodeRelMapper;

    /**
     * 查询推广码绑定关系
     * 
     * @param relId 推广码绑定关系主键
     * @return 推广码绑定关系
     */
    @Override
    public JtUserPromotionCodeRel selectJtUserPromotionCodeRelByRelId(Long relId)
    {
        return jtUserPromotionCodeRelMapper.selectJtUserPromotionCodeRelByRelId(relId);
    }

    /**
     * 查询推广码绑定关系列表
     * 
     * @param jtUserPromotionCodeRel 推广码绑定关系
     * @return 推广码绑定关系
     */
    @Override
    public List<JtUserPromotionCodeRel> selectJtUserPromotionCodeRelList(JtUserPromotionCodeRel jtUserPromotionCodeRel)
    {
        return jtUserPromotionCodeRelMapper.selectJtUserPromotionCodeRelList(jtUserPromotionCodeRel);
    }

    /**
     * 新增推广码绑定关系
     * 
     * @param jtUserPromotionCodeRel 推广码绑定关系
     * @return 结果
     */
    @Override
    public int insertJtUserPromotionCodeRel(JtUserPromotionCodeRel jtUserPromotionCodeRel)
    {
        jtUserPromotionCodeRel.setCreateTime(DateUtils.getNowDate());
        return jtUserPromotionCodeRelMapper.insertJtUserPromotionCodeRel(jtUserPromotionCodeRel);
    }

    /**
     * 修改推广码绑定关系
     * 
     * @param jtUserPromotionCodeRel 推广码绑定关系
     * @return 结果
     */
    @Override
    public int updateJtUserPromotionCodeRel(JtUserPromotionCodeRel jtUserPromotionCodeRel)
    {
        jtUserPromotionCodeRel.setUpdateTime(DateUtils.getNowDate());
        return jtUserPromotionCodeRelMapper.updateJtUserPromotionCodeRel(jtUserPromotionCodeRel);
    }

    /**
     * 批量删除推广码绑定关系
     * 
     * @param relIds 需要删除的推广码绑定关系主键
     * @return 结果
     */
    @Override
    public int deleteJtUserPromotionCodeRelByRelIds(String relIds)
    {
        return jtUserPromotionCodeRelMapper.deleteJtUserPromotionCodeRelByRelIds(Convert.toStrArray(relIds));
    }

    /**
     * 删除推广码绑定关系信息
     * 
     * @param relId 推广码绑定关系主键
     * @return 结果
     */
    @Override
    public int deleteJtUserPromotionCodeRelByRelId(Long relId)
    {
        return jtUserPromotionCodeRelMapper.deleteJtUserPromotionCodeRelByRelId(relId);
    }

}
